varying vec2 vUv2;
varying vec2 vUv;
uniform sampler2D texture2;
uniform sampler2D texture2Normal;
// varying vec3 vNormal;
varying vec3 vNormals;

void main() {
  vec4 color2 = texture2D(map, vUv2);
  vec4 colorText = texture2D(texture2, vUv);
  // csm_DiffuseColor.rgb = vNormals;
  //定义一个向量
  vec3 dirNormal = vec3(0.0, 0.0, 1.0);
  //计算方向的夹角
  float angle = dot(dirNormal, vNormals);

  if(angle > 0.0) {
    // 同向
    csm_DiffuseColor = mix(color2, colorText, 1. - colorText.r);
    // discard;
  }

}
